package Day22;

public class Teacher extends Person {
    private double salary;

    public Teacher(String name, int age, double salary) {
        super(name, age);
        this.salary = salary;
    }

    public Teacher(double salary) {
        this.salary = salary;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public String say() {
        return  " 老师： "+super.say() + "salary = "  + getSalary();
    }
    public void teach(){
        System.out.println(getName() + "老师正在教Java课程");
    }
}
